import React, { useReducer } from "react";

import { Provider } from "./providers/provider";
import { reducer } from "./reducers/reducer";
import Home from "./components/Home";
import MainLayout from "../../components/MainLayout";

const initialState = {
  pagination: {
    current: 1,
    pageSize: 10
  },
  query: {
    skip: 0,
    first: 10,
    sortOrder: "descend",
    sortName: "dateUpdated"
  },
  form: {
    isEdit: false,
    current: null,
    handleSubmit: undefined
  },
  modalOpen: false
};

const SysUser = () => {
  const state = useReducer(reducer, initialState);

  return (
    <Provider value={state}>
      <MainLayout>
        <Home />
      </MainLayout>
    </Provider>
  );
};

export default SysUser;
